import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
    history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path:"/home",
            name:'home',
            component: () => import('@/views/home.vue'),
        },
        {
            path:"/entry",
            name:'entry',
            component: () => import('@/views/entry.vue'),
            props: true
        },
        {

//例如
// const navigateToEntryWithId = (router, entryId) => {
//   router.push({
//     name: 'entryWithId',
//     params: { entryId }
//   });
// };
            path:"/entry/:entryId",
            name:'entryWithId',
            component: () => import('@/views/entry.vue'),
            props: true
        },
        {
            path:"/search",
            name:'search',
            component: () => import('@/views/search.vue'),
            props: true
        },
        {
            path:"/publish",
            name:'publish',
            component: () => import('@/views/publish.vue'),
            props: true
        },
        {
            path:"/profile",
            name:'profile',
            component: () => import('@/views/profile/Index.vue'),
        },
        {
            path:"/AccountSec/:accountId",
            name:'AccountSec',
            component: () => import('@/views/profile/SecondaryMenu/AccountSec.vue'),
        },
        {
            path:"/PersonalInfo/:accountId",
            name:'PersonalInfo',
            component: () => import('@/views/profile/SecondaryMenu/PersonalInfo.vue'),
        },
        {
            path:"/MessageNotify",
            name:'MessageNotify',
            component:()=> import('@/views/profile/SecondaryMenu/MessageNotify.vue')
        },
        {
            path:"/LikeHis",
            name:'LikeHis',
            component:()=> import('@/views/profile/SecondaryMenu/LikeHis.vue')
        },
        {
            path:"/forum",
            name:'forum',
            component: () => import('@/views/forum.vue'),
        },
        {
            path:"/forumAdd",
            name:'forumAdd',
            component: () => import('@/views/forumAdd.vue'),
        },
        {
            path:"/forumDetail",
            name:'forumDetail',
            component: () => import('@/views/forumDetail.vue'),
        },
        {
            path:"/forGetPwd",
            name:'forGetPwd',
            component: () => import('@/views/forGetPwd.vue'),
        },
        {
            path:"/register",
            name:'register',
            component: () => import('@/views/register.vue'),
        },
        {
            path:"/login",
            name:'login',
            component: () => import('@/views/login.vue'),
        },
        {
            path:"/EmailSec",
            name:'EmailSec',
            component:()=>import('@/views/profile/SecondaryMenu/ThirdMenu/emailSec.vue')
        },
        {
            path:"/QuestionSec",
            name:'QuestionSec',
            component:()=>import('@/views/profile/SecondaryMenu/ThirdMenu/questionSec.vue')
        },
        {
            path:"/ViewHis",
            name:'ViewHis',
            component:()=> import('@/views/profile/SecondaryMenu/ViewHis.vue')
        },
        {
            path:"/HelpCenter",
            name:'HelpCenter',
            component:()=> import('@/views/profile/SecondaryMenu/HelpCenter.vue')
        },
        {
            path:"/Address"
            ,name:'Address',
            component:()=> import('@/views/profile/SecondaryMenu/shopping/Address.vue')
        },
        {
            path:"/Collections"
            ,name:'Collections',
            component:()=> import('@/views/profile/SecondaryMenu/shopping/Collections.vue')
        },
        {
            path:"/Points"
            ,name:'Points',
            component:()=> import('@/views/profile/SecondaryMenu/shopping/Points.vue')
        },
        {
            path:"/changePassword",
            name:'ChangePassword',
            component:()=> import('@/views/profile/SecondaryMenu/ThirdMenu/changePassword.vue')
        },
        {
            path:"/store",
            name:'store',
            component:()=> import('@/views/store.vue')
        },
        {
            path:"/productsDetail/:productId",
            name:'productsDetail',
            component:()=> import('@/views/productsDetail.vue')
        },
        {
            path:"/order",
            name:'order',
            component: () => import('@/views/order.vue'),
        },
        {
            path:"/store",
            name:'store',
            component: () => import('@/views/store.vue'),
        },
        {
            path:"/productsDetail/:productId",
            name:'productsDetail',
            component: () => import('@/views/productsDetail.vue'),
        },
        {
            path:"/orderDetail/:orderId",
            name:'orderDetail',
            component: () => import('@/views/orderDetail.vue'),
        },
    ]
})
export default router